package top.zhaoyuliu.logbook.server.connect.thread;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;

/**
 * Copyright © 2021 Arain. All rights reserved.
 *
 * @Title: TimeThreadPool.java
 * @Prject: logbook-server
 * @Package: top.zhaoyuliu.logbook.server.connect
 * @Description: <功能详细描述>
 * @author: Arain
 * @date: 2021年1月26日 上午9:46:15
 * @version: V1.0
 */
public enum TimeThreadPool {

	INSTANCE;

	private final ScheduledExecutorService executor;
	private final int cup = Runtime.getRuntime().availableProcessors();

	private TimeThreadPool() {
		executor = new ScheduledThreadPoolExecutor(cup, Executors.defaultThreadFactory());
	}

	public ScheduledExecutorService executor() {
		return executor;
	}
}
